<?php
if (!defined('SYSTEM_ROOT')) { die('Insufficient Permissions'); }
function template($file,$method,$tem = '') {
	switch($method){
		case 'f':
			include SYSTEM_ROOT.'/'.APP_NAME.'/'.$file.'.php';
			break;
		case 'v':
			$html = empty($tem) ? file_get_contents(SYSTEM_ROOT.'/'.APP_NAME.'/View/default/'.$file.'.html') : file_get_contents(SYSTEM_ROOT.'/'.APP_NAME.'/View/'.$tem.'/'.$file.'.html');
			$str = preg_replace_callback('/\{(.*?)\}/',function ($a){return eval('return '.$a[1].';');},$html);
			echo $str;
			break;
		case 'c':
			include SYSTEM_ROOT.'/'.APP_NAME.'/Controller/'.$file.'.php';
			break;
	}
}